package com.gxa.modules.service.impl;

import com.gxa.common.vo.ResultVo;
import com.gxa.modules.mapper.BasicInformationMapper;
import com.gxa.modules.pojo.Customer;
import com.gxa.modules.service.BasicInformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BasicInformationServiceImpl implements BasicInformationService {
    @Autowired(required = false)
    private BasicInformationMapper basicInformationMapper;
    @Override
    public ResultVo basicInformation(long loan_id) {
        long customer_id=basicInformationMapper.selectCustomer_id(loan_id);
        Customer customer=basicInformationMapper.selectCustomer(customer_id);
        //装居住信息
        customer.setLiveInformation(basicInformationMapper.selectLiveInformation(customer.getLive_information_id()));
       //装联系人信息
        customer.setContact(basicInformationMapper.selectContact(customer.getContact_id()));
//        装客户职业信息
        customer.setProfessional(basicInformationMapper.selectProfessional(customer.getProfessional_id()));
//        身份认证信息
        customer.setIdentityAuthentication(basicInformationMapper.selectIdentityAuthentication(customer.getIdentity_id()));
//        客户银行信息
        customer.setBank(basicInformationMapper.selectBank(customer.getBank_id()));
//        客户车辆
        customer.setCarProveList(basicInformationMapper.selectCarProve(customer_id));
        System.out.println(customer);
        ResultVo resultVo=new ResultVo();
        resultVo.setCode(200);
        resultVo.setData(customer);
        return resultVo;
    }
}
